jQuery(document).ready(function() {
	var config=new RegClientConfig();
	var sourceUtils=new SourceUtils();
var sourceUtils=new SourceUtils();
var currentUrl=window.location.href;
var sourceId=currentUrl.substring(currentUrl.lastIndexOf("/")+1, currentUrl.length);
//alert('sourceId=|'+sourceId+"|");
//var tempSource;
//if no id in the url then we assume an add is called for

if(sourceId!=''){
	//get the source
	jQuery.getJSON(config.registryAddSourceUrl+sourceId, function(sources) {
		//alert(config.registryAddSourceUrl+sourceId);
		tempSources=sources;
		if(sources.source.length==undefined || sources.source.length==0){
			$("#NoSourceIdExists").html("Error DAS Source does not exist in the registry");
		}else{
			//alert('pop tempSource');
			var html=sourceUtils.displaySourcesDetails(sources);
			//alert('html='+html);
			$('#sourcesDetails').html(html);
		}
	});
}
	
	
});